#!/usr/bin/env perl

use utf8;

chomp(@lines = <STDIN>);

@sorted = sort(@lines);

foreach(@sorted){
	print $_.' ';
}

print $_;

foreach(@sorted){
	print $_."\n";
}
